package com.kaiwukj.android.ufamily.mvp.ui.page.mine;

import com.kaiwukj.android.mcas.mvp.IModel;
import com.kaiwukj.android.mcas.mvp.IView;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.ListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.MyAddressUpdateParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DoorAccessDeviceResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DoorAccessRecordResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyAddressResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyHouseMemberResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyHouseResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderEvaluateResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

public interface MineContract {
    interface AddressView extends IView {
        void onFetchAddress(List<MyAddressResult> results);
    }

    interface EvaluateView extends IView {
        void onFetchEvaluate(List<OrderEvaluateResult> results);
    }

    interface HouseView extends IView {
        void onFetchHouse(List<MyHouseResult> results);

        void onFetchHouseMember(List<MyHouseMemberResult> results);

        void onFetchDoorAccess(DoorAccessDeviceResult result);

        void onFetchDoorRecord(List<DoorAccessRecordResult> results);
    }

    interface Model extends IModel {
        Observable<ListResp<MyAddressResult>> fetchMyAddress(int page, int pageSize);

        Observable<Integer> deleteAddress(int id);

        Observable<Integer> updateAddress(MyAddressUpdateParams params);

        Observable<Integer> addAddress(MyAddressUpdateParams params);

        /**
         * 获取我的房屋列表
         *
         * @return List<MyHouseResult>
         */
        Observable<List<MyHouseResult>> fetchMyHouse();

        Observable<List<MyHouseMemberResult>> fetchHouseMember(Integer roomId);

        Observable<Integer> addHouseMember(Map<String, Object> params);

        Observable<Integer> delHouseMember(int ownerRoomId);

        /**
         * 获取门禁设备
         *
         * @return
         */
        Observable<DoorAccessDeviceResult> fetchDoorAccessResult();

        /**
         * 获取开门记录
         *
         * @param month    monthDateStr 2020-6
         * @param page     1
         * @param pageSize 12
         * @return List<DoorAccessRecordResult>
         */
        Observable<ListResp<DoorAccessRecordResult>> fetchDoorRecord(String month, int page, int pageSize);

    }
}
